<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* text-align 可以定义行内元素如何相对他的块级父元素对齐 */
    div {
      background-color: #f00;
      color: white;
      text-align: center;
    }

    .s1 {
      width: 100px;
      background-color: blue;
    }

  </style>
</head>

<body>
  <div>
    <span class="s1">
      <span class="s2">我是内容</span>
    </span>
  </div>
</body>

</html>